package Test;

import java.awt.BorderLayout;
import java.awt.Container;
import java.awt.Dimension;
import java.awt.GridLayout;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;

import javax.swing.Box;
import javax.swing.JButton;
import javax.swing.JFileChooser;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JProgressBar;
import javax.swing.JScrollPane;
import javax.swing.JTextArea;
import javax.swing.JTextField;
import javax.swing.border.Border;
import javax.swing.border.EmptyBorder;

public class GUI extends JFrame{
	
	
	
	JTextArea textfield1 = new JTextArea(); 
	static JTextArea textfield2 = new JTextArea();
	public int wertlang4;

	JLabel title1 = new JLabel("Input");
	JLabel title2 = new JLabel("Output");
	private File inputFile;
	private int windowSize;

	
	

	

	
	
	
	
	
	public void createGui2(){
	
		
		// set layout manager, and a common border to use
		setSize(1200,800);	
		Container content = this.getContentPane();
		content.setLayout(new BorderLayout());
		Border whiteSpaceBorder = new EmptyBorder(5,5,5,5);
						
		// top box 
		JPanel topBox = new JPanel();
		topBox.setLayout(new GridLayout(1,2));
		title1.setBorder(whiteSpaceBorder);
		title2.setBorder(whiteSpaceBorder);
		topBox.add(title1);
		topBox.add(title2);
		content.add(topBox, BorderLayout.PAGE_START);
		
				
			
				
		//center box
		JPanel centerBox = new JPanel();
		centerBox.setLayout(new GridLayout(1,2));
		textfield1.setBorder(whiteSpaceBorder);
		textfield2.setBorder(whiteSpaceBorder);
	
		JScrollPane scrollPane = new JScrollPane(textfield1);
		JScrollPane scrollPane2 = new JScrollPane(textfield2);
		centerBox.add(scrollPane);
		centerBox.add(scrollPane2);
		content.add(centerBox, BorderLayout.CENTER);
		
		//progress bar
		
		
	}
	
	

	public GUI(File inputFile, int windowSize){
		this.inputFile = inputFile;
		this.windowSize = windowSize;
		
	}
	

	public GUI() {
		
	}
	

	public void print(File Inputfile){
		
		inputFile=Inputfile;
		
		
		String total="";
		
		try {
			BufferedReader in = new BufferedReader(new FileReader(inputFile));
		String text = null;
		
		
			try {
				while((text = in.readLine()) !=null){
				
				total=(total +"\n"+text);
								
				}
				
				TextGenerater TextGenerater = new TextGenerater(total);
				
				
			} catch (IOException e) {
				
				e.printStackTrace();
			}
			
			
			
		} catch (FileNotFoundException e) {
			
			e.printStackTrace();
		}
		
		
}
	
	}
